﻿
@{
    ViewBag.Title = "PayHtml";
}
<link href="~/HelpContent/Css/PayHtml.css" rel="stylesheet" />



<div id="app" class="Body">
    <div class="Content">
        <div class="Top">
            <span>订单号</span> <span>123124214</span> <span>的支付记录</span>
        </div>
        <div class="Bottom">
            <div id="test"></div>
        </div>
    </div>
</div>






<script>
    let oid = sessionStorage.getItem("oid");

    if (!oid) {
        location.href = "/Order/OrderHtml";
    }

    function LoadData() {

        $.get("/Order/GetAllPay", { id: oid }).then((res) => {
            console.log(res.data);
            BindTable(res.data);
        });
    }

    LoadData();


    function BindTable(obj) {

        layui.use('table', function () {
            var table = layui.table;

            //第一个实例
            table.render({
                elem: '#test'
                , loading: true,
                limit: 99999
                , data: obj //数据接口

                , cols: [[ //表头
                    { field: 'OrderName', title: '订单号' },
                    {
                        field: 'Money', height: 100, templet: (d) => {
                            return `￥${d.Money}元`;
                        }, title: '支付金额'
                    },
                    {
                        field: 'Ptype', height: 100, templet: (d) => {
                            switch (d.Ptype) {
                                case 0:
                                    return '微信支付';
                                    break;
                                case 1:
                                    return '余额支付';
                                    break;
                                case 2:
                                    return '现金支付';
                                    break;
                            };
                        }, title: '支付类型'
                    },
                    {
                        field: 'result', height: 100, templet: (d) => {
                            if (d.result == 1)
                                return '支付成功'

                            return '支付失败';
                        }, title: '支付结果'
                    },
                    {
                        field: 'time', height: 100, title: '支付时间'
                    },
                ]]
            });




          


        });
    }

</script>


